using System;
using L=Science.Physics.GeneralPhysics;

namespace Serway.Chapter13
{
	/// <summary>
	/// Example03: The Density of the Earth
	/// Using the known radius of the Earth and the 
	/// fact that g = 9.80 m/s^2 at the Earth's surface, 
	/// find the average density of the Earth.
	/// \rho_E = 5.51 \times 10^3 kg/m^3
	/// </summary>
	public class Example03
	{
		public Example03()
		{
		}
		private string result;
		public string Result
		{
			get{return result;}
		}
		public void Compute()
		{
			double R = L.Gravitation.RadiusOfEarth;
			L.Mass m = new L.Mass();
			m.kg = L.Constant.AccelerationOfGravity
				*R*R/L.Gravitation.Constant;
			L.Volume v = new L.Volume();
			v.mCUBE = 4.0/3.0*Math.PI*R*R*R;
			L.Density rho = new L.Density(m,v);
			result += Convert.ToString(rho.kgPERmCUBE);
		}
	}
}
